package cn.xuetian.activiti.configuration;

import org.activiti.engine.*;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author zhaosen
 * @version 1.0
 * @date 2020/4/2 10:19
 */
@Configuration
public class EngineBeans {


    @Bean
    public ProcessEngine getProcessEngine() {

        ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();

        return processEngine;
    }

    @Bean
    public RuntimeService getRuntimeService() {

        ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();

        return processEngine.getRuntimeService();
    }

    @Bean
    public TaskService getTaskService() {

        ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();

        return processEngine.getTaskService();
    }

    @Bean
    public IdentityService getIdentityService() {

        ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();

        return processEngine.getIdentityService();
    }

    @Bean
    public RepositoryService getRepositoryService() {

        ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();

        return processEngine.getRepositoryService();
    }

    @Bean
    public HistoryService getHistoryService() {

        ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();

        return processEngine.getHistoryService();
    }


    /**
     * 可选
     * @return
     */
    @Bean
    public FormService getFormService() {

        ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();

        return processEngine.getFormService();
    }

    /**
     * 可选
     * @return
     */
    @Bean
    public ManagementService getManagementService() {

        ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();

        return processEngine.getManagementService();
    }


}
